package ppp.hhh.the.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
import ppp.hhh.the.model.User;

@Controller
public class MVCDemoController {
    @GetMapping("/mvcdemo")
    public ModelAndView hello(){
        User user = new User();
        user.setId(1);
        user.setName("zhonghua");
        user.setAge(18);
        ModelAndView mav = new ModelAndView("mvcdemo");
        mav.addObject("user", user);
        return mav;
    }
}
